<!DOCTYPE html>
<html >
<meta charset="utf-8">
<head >
<#include "/page/include.ftl">

</head>
<body class="white-bg">
	<div class="wrapper wrapper-content animated fadeInRight ibox-content">
		<form class="form-horizontal m" id="form-mq-edit">
		<input name="id"  type="hidden" id="id" value="${id!}"/>
			<div class="form-group">
                        				<label class="col-sm-3 control-label">插件名称：</label>
                        				<div class="col-sm-8">
                                        	<input class="form-control" type="text" name="plguinname" id="plguinname" value="${name!}">
                                        </div>
                        </div>

			<div class="form-group">
				<label class="col-sm-3 control-label">是否加密：</label>
				<div class="col-sm-8">
					<select id="encrypt" name="encrypt" class="form-control m-b" with="100px">
					<option value="${encrypt!}"><#if encrypt=="1">加密 <#elseif encrypt=="2">非加密 </#if></option>
			               <option value="2">非加密</option>
 				           <option value="1">加密</option>
	                   
	                </select>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label">数据传输结构：</label>
				<div class="col-sm-8">
					<select id="datatype" name="datatype" class="form-control m-b" with="100px">
					<option value="${datatype!}"><#if datatype=="xml">XML <#elseif datatype=="json">JSON<#else>未知 </#if></option>
			               <option value="xml">XML</option>
 				           <option value="json">JSON</option>
	                   
	                </select>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label">MQ类型：</label>
				<div class="col-sm-8">
					<select id="mqtype" name="mqtype" class="form-control m-b" with="100px">
					<option value="${mqtype!}">${mqtype!}</option>
			               <option value="activemq">activemq</option>
 				           <option value="rabbitmq">rabbitmq</option>
	                        <option value="rocketmq">rocketmq</option>
	                </select>
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label">是否批量：</label>
				<div class="col-sm-8">
					<select id="is_batch" name="is_batch" class="form-control m-b" with="100px">
					       <option value="${is_batch!}"><#if is_batch=="1">非批量 <#elseif is_batch=="2">批量 </#if></option>
			               <option value="2">批量</option>
 				           <option value="1">非批量</option>
	                   
	                </select>
				</div>
			</div>


			<div class="form-group">
				<label class="col-sm-3 control-label">表名称：</label>
				<div class="col-sm-8">
					<input class="form-control" type="text" name="table_name" id="table_name" value="${table_name!}">
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label">HOST名称：</label>
				<div class="col-sm-8">
					<input class="form-control" type="text" name="host" id="host" value="${host!}">
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label">端口号：</label>
				<div class="col-sm-8">
					<input class="form-control" type="text" name="port" id="port" value="${port!}">
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-3 control-label">用户名：</label>
				<div class="col-sm-8">
					<input class="form-control" type="text" name="username" id="username" value="${username!}">
				</div>
			</div>
			
			<div class="form-group">
				<label class="col-sm-3 control-label">密码：</label>
				<div class="col-sm-8">
					<input class="form-control" type="text" name="password" id="password" value="${password!}">
				</div>
			</div>
			
			<div class="form-group">
				<label class="col-sm-3 control-label">主题名称：</label>
				<div class="col-sm-8">
					<input class="form-control" type="text" name="queue" id="queue" value="${queue!}">
				</div>
			</div>
			
			<div class="form-group">
				<label class="col-sm-3 control-label">子主题名称：</label>
				<div class="col-sm-8">
					<input class="form-control" type="text" name="tags" id="tags" value="${tags!}">
				</div>
			</div>
			

		</form>
	</div>
	
	<script src="${rc.contextPath}/static/ajax/libs/select/select2.js"></script>
	<script>

	 var prefix = ctx;

        
        
         $("#form-mq-edit").validate({
                	onkeyup: false,
                	rules:{
                	    "pluginname":{

                           required:true,
                        },
                		table_name:{
                			required:true,
                		},
                		host:{
                			required:true,
                		},
                		port:{
                		    required:true,
                			digits:true
                		},
                		topic:{
                		  required:true,
                		}
                	},
                	messages: {
                        "menuName": {
                            remote: "菜单已经存在"
                        }
                    },
                    focusCleanup: true
                });

                 function submitHandler() {
        	        if ($.validate.form()) {
        	            $.operate.save(prefix + "mq/update", $('#form-mq-edit').serialize());
        	        }
        	    }
         
         

		
    </script>
</body>
</html>
